adding a method to get id by specifying a field