added multiple layout support