add some type check and error exports