error layout handling corrected