Adding feature to handle errors.