fixed bug in main file