fixed small bug in wrapper