avoid slice bound errors