working with master-detail template