fixed up bug in update