bugfix for slice when array.length -start < size