Fixed data not being persisted to database on occasion