merge from Join to fix the mess code