Incorrect html marking after ajax updates