fix some bugs. left with update not working