Fixing error opening urls when opt.app is not defined