Added mesage to when tgas is invalid
Fixed bug when an error happen