fixed my logic