change cloud input and fixed distance checking bug