prevented duplicate topics being entered in mongodb