fixed broken update function but broke other stuff