decouple foreground and user click