Fixed a small logical flaw