fix length and width bug