fixed bugs in last fix