Fixed a critical bug