some small changes and bug fix