added check for one element edge case