flatmap with try
finish the translation of Try