js syntax fix and layout spaceing