playing with functions in event handlers