added one second delay to prevent 100% cpu consumption