minor logic bug