fix empty refer_url and add test cases