fixed some variables not pointing to self