fixing bug lonnylot pointed out