make on_boundary testable