Improved error handling

If policy editing fails the previous view is restored