Trap term and call exit if sleeping