Make sure handler is not garbage collected, thanks @jepeg729