fixed typo and regex jslint warning added sendraw for the trainstate