autoclose and js beautify fix