Updated to use longs for ids