Fixed a crucial bug