Made js hooked of before and after save synchronus