correct scope issue, add vars to php