fix bug in explode function