Bug fix & debug support

bug fix & debug support