fix bug: sometimes, the referrer will be null