sortMethod surrounded with try-catch