changed to check array