adding success message only when previous state is addPrescriptionDetails