Case Statement work in loop