added conditional display of refresh/close buttons due to security rescrictions related to these functions