fixed factory by Zeke
reverted back to using event handler instead of factory