fix crash when rotating phone