fix duplicate path bug; improved logging