updated script based on packages dirs