add if isset statement to try to fix variables- probably still won't work