Fixes issue where insert is not finding a matching element