fix referrer plugin, check that referrer can be parsed before saving