Fix error for dividing by 0