Add check for duplicate file