check for NULL using === instead of == (the latter also evaluates to true for FALSE)