fix a bug with metrics window