nasty bug fix