fixed bug in main files