Fixed 'undefined' issue