Svaing function fixed.