fixed bug  in case layout was equal to none or null (as a string)