loop timing issue