added a timeout for the writing check, so that it will only stay true, aslong the user is writing continually