Fix problems caused by referer