bugfix in function generateSelfLoopRdd