make view button dynamic