fixed typo, add try catch