Added save on close and remove on server