added query method to list() function