fixed class scoped globals
fixed merge conflict