correction in node selection algorithm
Merge pull request #1373 from danmcp/master

Fixing find available algorithm