convert string to struct