fix type
add exception handler