fixed a bug of displaying popup
fix dimension bug