Fixed a bug for online mode