fix Layout and conditions