added a try catch block to find a possible error