implemented all events

also fixed the .close() method for when .destoryOnClose = true