fixed underlying bug in porting