fix check if defined bug