Fixed a fatal bug