add exception handler
Fixed error messages