remove extensions in reverse order