fix porting error