added additional checks around serialized data to ensure it's a valid format