fixed a divide by zero error