added functions to query views