fixing issue with query end-point