fix keyoptions serialization