some fix, lots of bugs