fix multiple bugs in the application. app now fully functional