fix some bugs... I hope