added code for updating object