Re-define click handlers for files and directories upon adding them