def get_serial_number(deck):
    """
    Remove unwanted characters from the end of the serial number
    and return sanatized serial number

    :params deck: stream deck
    :returns correct serial number of stream deck
    """
    with deck:
        serialnumber = deck.get_serial_number()
        serialnumber = serialnumber.replace("\x00", "").replace("\x01", "")
        return serialnumber