other idea, could this anonymous function be shared between calls instead of creating a new one object every time? thanks