Change compare function and query req prototype