add unittest and update wrapper