How to add buffers before or after events