tweak enter/leave code, remove debug output