added clause to insert that should prevent inserting a tag multiple
times, which may be cause by race conditions.