fixed a small mistake

changed scanner's nextLine to next() as it terminated my method for some
reason.