bugfix for has_one set to nil when nil