nasty stack bug fixed