dynamic length fix