fix the bug in original version