Fix delay loop