Fix error when app is not defined