use compact to send variable to view