Add uniqueness check for files

Fix #86