Modification of polymers by chemical after-treatment