Issue #1 Write undefined on console - fixed