second ajax call after getting ids from the db