fix a nasty bug