Bug Fix unnecessary  "undefined" in output