Added negative balance check
Sleep statement for the heartbeat loop