changed query method