working version with embedded app