finally spotted the stupid performance problem