Added a delay function - in seconds