added restricting query to user - fixed general mechanism