Handle 0 as value in javascript reverse urls