add getBycode method