Reinstate error handling