add setLength method