fixing length bugs