fix spontaneous exception
tweak performance