Fixed the amount of time stored in db