FIX: remove token before writing