fixed actually saving stats on close -_-