fix setX for android 2.x
fix loop function