fix bug for input sizes and not being the first or last child