add delay in loop