fixed the bug in SimWindow.cpp