cleanup
Trap handeling fixes