only add value if it's not undefined