fix npe when there is not type handler
add return value