Adds check for object to avoid connection errors