added file checks