Add query method to the model