working on scoping issues ....