Fixed issue regarding duplicate entries to DB.