fixed join function