Css reverting, javascript updating