use console instead of deprecated util.puts/error