cast id in insert method