Added events
Fixed compile errors
Fixed compile errors