before starting layouts