fix broken windows with jsbeautifier
add postUpdate function
clean up dup code and call postUpdate