fix crash bug in TestApp