added print debugger in leave