fixed wrapper code