small fix to check if attribute value is null prior to save