fixed erroneous use of id field in insert and update statements