fixed one logic misstake