fixed bug with incorrect logic with redefinition of main file