db.commit() is needed when updating data in db.