test code for trap: but it doesn't work