added dep validation and allows non-functions