trace prepare method