fixing bug where 0s were ignored