fixed a bug of unexpected display closing