add checkurl function,fix a bug