create a once function