fix crash for rotate phone