Fixed problem with update not writing to db