Declare reactive variable at the function level