Fixed uncaughtException issue