bug fix found by solo999