added Boundary Handling to shared kernel