moved header view code from controller to header view file