adding logic for dependent