fixed refresh functionality