fixing some problems to run this application.
make changes to use unittest