fix Retain Component Selection bug, reformat