Fix detect getLayoutMode