call updatevisibility() at the end to make sure all relevant fields are shown