fixing small bug on refresh