readded if statement with app context