bug in helperfunction fixed