handled raw sql queries as well