updates ui and init