changed check from global level to file level