fixed problem of correct length