Added storing last device used.