some state fixes
usage of module scope
changes