Fixed the qurey