minor fix for setting ID before returning after inserting