Successfully getting values from plugins using separate function. Working very nicely now.