added db.commit() line