added check for the query arguments