bug-fix and improvement