figured out nasty bug