better handling of focused element