Fixed a bug where sessions wouldn't be saved