changed debug handling

not nice, but the only possibility ^