Modified the handler to work with the new Boundary Events API.