before filling layout