fixed len < 1 problem