minor logic fix