fix block removing bug, code chore