a few bug fix, still not working