Trying to make the status checks for all objects,  need help in making this a function