Fixes the use of self in setTimeout