implementing master detail flow