Insight into the mechanism of sidewall functionalization of single-walled nanotubes: an STM study