Add onLoop event