added sql query support