getting ids from arrays