fixed bug in main class