modified script for searching dependency