bug fix
merged master into r2_index
for version 2