fix crash at screen rotation