Fix the bug of resetting