Q.allSettled, it just accept functions, so with using it in that way,  the function declarated and at the same time, is executed.