added try except for invalid ids