debug functionality added