Check the UI control pointer before using.
Use std:vector to hold std:function array to avoid crashes.
see http://stackoverflow.com/questions/9947299/stdfunction-crashes-when-used-in-array-on-stack.