fixed initializtion for length