fix a corner case bug