started distance checking function in autobot