added code to check the trap address.