fixed divided by zero bug