fix crash when cipher changes