Updated controller and serial to have a close function to close the serial port.