added file writting check