adjusting the valid title method so that it trims a title that is too long rather than throw an exception