Set the layout to null instead of none when needed