added haslength method