Fixed so null does not hit delete switch