Problem with Stacktrace in function compute errpr ()