fix layout code