better fix for inf issue