Fix timer that saves the database