added raw sql query functionality