Modified writes to database so that a 0 is written for stop time when the row is created in the database