Add referer logic