capturing console output and redirecting to html div