fixed a bug in visualization