Added check for divide by zero