fixed crash with horizontal layout