added loop delay