fix crash caused by missing layout_width and layout_height