fixing issue with getURLPath() javascript method