Fixed a bug.

Fixed a bug that will crash the program.