added try-catch block to receive the answer