reimplemented debug package