Fixed a bug with a try catch