moved trace procedure into the protected type