updates error handling and improves views