fix small bug with lego type not saved from strtok