improve registering, add new method stopApp