make it work
fix a few bug