referer can be nil.