Saving events in background (not working version)