added extra conditions in daemon shutdown expression checking for undefined attributes