rendering and refreshing correctly