Fixed and error with variable scoping into profile