update scripts to handle dependencies