swicth check logic