corrected the query to make sure file access is grantable