fixed update bug

several other bugs fixed