- fix the potential buffer overflow (from issue #81). - reduce the number of implementations (3 in total) of the callback ui functions.