sending actions when switching between files