changed invalid to nil