fixed nasty bug