Added 5 second loop to wait for job to complete