Created Dynamic error handling