fix reference to global
small code clean up