minor adjust code for remove extensions