fix loop delay not being used