Add handler to protect against CSRF attacks