added not-nil to throw exception when nil is passed