add condition to support 0 as valid integer