added function that can be invoked a limited number of times