fix an issue with jquery overwriting div contents