fixed error with undefined variables

Moving function that loads config from url params to controller introduced small error with not properly declaring variables.