selected preview logic