Nasty bug in extendUrl