add id feature and fix update funciton