implemented exception based error management