fix for a few of the undefind variable errors

let's hope this fixes it :)