Fixing the loading text from showing 'UNDEFINED'