using $.proxy instead of `self`