MB-146 #Added logic to fix double entries