added updated sql