Restore Window history (a bit hacky but works)