Fix JavaScript urlfield undefined error