added resetToSerialMode function