Added null or empty name check