fixed bug with calling this in a callback