fix app upgrade bug