Implemented delay in seconds for lower CPU usage