handle traps