added query execution method