added serializeKey