corrected a bug introduced by my stubborness last time