fixed divide by zero warning