fix bug of taking 0 as invalid param