tested and bug fix