implementing try-catch
modified help