Function definition must be before export