Added ActionListener with try{}catch{} statement.