fixed update sending state in the database