trycatch bug fix