fixed the bug in following