minor logic correction