revised version

fix 2 bugs