fixed wrong nbd number assignation

reverting also previous unneeded changes