Making applications as optional in query statement if its not specified by the job.