add safer key joining method