refactoring , fix crash issue