cahnges constructor
added dependencies
check for array
fixes