Adding function to get pending applications