improved check for main file
Merge pull request #45 from gkoychev/better-main-check

improved check for main file