only slice when necessary