Fixing error caused by assiging a null value to backtrace variable