error printing function updated.