solved path count bug
use q promises to collect results