update ai only once every two seconds