update space error code/change debug function