Fixed bug with more than 2 proc