The logic seems to not work when passing a launch file to roslaunch (instead of pgkname and launch file name).