fix js errors from port
porting complete