add debug code for buildpackage