Why arduino ethernet disappear from my DHCP table?

Hi, I am really new in Arduino but I've been programming for netduino for sometime. Now I encountered a problem which my arduino does not appear on my DHCP client table in my router. Here is a snippet of my code:

if(Ethernet.begin(mac)) {
  else {
    printToPrinter("No DHCP response, using static IP address.");
    Ethernet.begin(mac, ip);

This piece of code is my my setup() and printToPrinter is a function that prints to my thermal printer. When I run this code last time the Ethernet.begin(mac)hangs, I resolved somehow. Now I can see my printer prints out the IP address so it means the DHCP worked. When I kept writing code that envolves EthernetServer and EthernetClient, problem arrises. The problem is that all my code work fine when I plugged my USB cable, and I can see my arduino in my DHCP client table, but nothing works when I let this thing run standalone. Did I do anything wrong? I will post the entire source code if it helps. Thank You!

Is your sketch interacting with the USB port in any way?

If it is, you need to understand what will happen to your sketch when the USB is not connected.

If it isn't, consider whether you have been relying on the USB as a power supply and whether the supply you are using in standalone mode is adequate.