bugfix in main method