Fixed bug in joining