adding checks for files