Modified thread model: simplified passing of last id inserted in thread to write() function of comment model