fix norm function