fixed console.log to output correctly.