bug fix: slicing was not checking dimensions