Changed script to include stacktrace