added handling of id not found