Changed getbyid to return the sq of id