Border funding deal reached