removed catch all catch block because it hides the stack trace of what happened
fixed two type check bugs