bugfix

follow the bugfix of the original code.