check if the end of the company array has been reached