event callbacks moved to global scope