checked query4 optimized