changed window. to self. for getting frame object