check overwrite of file