fixed bad length reference