fixed #7 as well as updating/cleaning up the query for facility users