added nil check for TransformKeys