add lifecycle event handlers to options page