fix for nasty bug