more error checks and fixed test url
fixing bug in stacktrace output