fix bug in length rule