fix app logic and html