TypeError: Cannot read property 'goto' of undefined