trying to pass value from header function to set variable value but its not working