Prevent app crash after device rotate