updating ui so dont get weird flicks on page load