Fixed bug where no of entries added was incremented even if entry was duplicate.