fix bug in downloadpackages script