fixed some query