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

improved check for main file