bug fix by 柏信 at http://my.ss.sysu.edu.cn/wiki/pages/viewpage.action?pageId=221184017&focusedCommentId=222756878#comment-222756878