fixed a bug about RESTful state on unload apps