fixed issues in group access query