changed query to privs and syntax return without if