add masterID and init layout