changed nil into 0