solved adding problem when empty detail was added.