layout func fix