small modification and bug fix