Corrected the return value for a query