Avoid repeated event bindings in main page