more work on add key dialog, still not finished