Script error logging improved

still need better detection