fixed while loop in alltime
fixed while