Bug fixed in main class