use events if running on server