fixed bug in control panel html structure
made preview save synchronously before displaying