fix a div zero bug