before changing to custom error
complied with feedback.
trying to code msm2 for error handling.