extra check for undefined, since values of 0 should be allowed