fix update command and add test for this