fixing onShow bug