Not sure why this code is the way it is, but we need to prevent duplicate entries, so here's a bandaid.