Working code
some fixes
revision
added mutex to be sure Application run ony single instance