But there is no any way of preventing it displays this final error message so ugly? Because only it happens when the user closes the program. While he works with it the error does not appear.

regards