more flexible way to read id