correction to the number of attempts to remove nans