I moved this code out of the function because we look at the proc state to do concurrent downloads on the machine (as far as I could see). I forgot to remove this function after making this change which is why the above remark should have been removed.