Same as above: Here, instead of just checking the properties we should rather check that the document can be fetched from the database. I would call application.findApplicationById(...) for this.