updates to id and erorr catching