fix fatal bug and add location, subscribe event handle stub