Added a try catch on the getValue