fixed divide by zero exeption