Added more trap functionality