Fixing divide by 0 error