hopefully removed bug for old file deletion. Test follows later