var redirectTo = toState.data.permissions.redirectTo; - was using permission var  that had been removed.