minor changes and bug fix