updated sql, added commit in database