Adds custom occur function