fixed duplicate checking