js {} organized, to fix end div problem