fixed some bugs in arap