Add if statement to remove last octet if 0