use one function for performing queries
missing import