fix bug causing double entries.