After using the last sc.next() there is still some data left in the buffer. You need to clear the buffer after calling next()