Fixed 'undefined' error and added show/hide UI functions.