prevent calling callback multiple times