Fix error handling in the windows gui