end of fixing ticket #3097 Better error message handling