add key path mapping and bug fix