fixed divide by 0 possibility