last update with a lot of bug fix