html5 mode switched off.
refactored saving logic