rewrite debugsystem