added enter finally and removed debug code