Added selfInvoking function