fixes so that refresh event is correctly triggered