clear the foreground and background before the flush