fix a few bug