adapting History States and more media tweaks