Removed nested thread and clean-up
Clean up