minor logic edit