Code for saving trailer info. Fixed some errors