Changed name of package array from $app to $packages