fix bugs in debugs