Working solution without user interaction