changed print() to pdebug()
fixed closure bug