fix scoping of class bodies