using refresh instead of flush