be defensive and handle zero