Why the duplication between this and line 150? It seems like you'd only need one of the event handlers.