working version with app file