added check to eliminate duplicate records