Fix issue with undefined variables. Add missing dependancy