fixed divide by zero error