reworked syntax to make $row available to both options
added and removed test statements
setup error handling for null dependency
Removed test statements