updated test with better condition