new way to handle errors