boundary calc fix