Handling asterisks in the query