Fix bug with app initialization