fixed saving preferences error