fixing catch exception error