updated core file to check for valid url and host