# Why this header code takes references chapter(numberless) as chapter number 4 in header instead of only word Refrences

\usepackage{lastpage} % number of last page
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
\rmfamily \bfseries
\ifnum\value{chapter}>0 \chaptername\ \thechapter. \fi
\leftmark}

\renewcommand\footrule{\color{myblue}\begin{minipage}{1\textwidth}
\hrule width \hsize height 2pt \kern 1mm \hrule width \hsize
\end{minipage}\par}%

\begin{minipage}{1\textwidth}
\hrule width \hsize \kern 1mm \hrule width \hsize height 2pt
\end{minipage}}%

\lfoot{}
\rfoot{Page \thepage\ of \pageref{LastPage}}


Unfortunaly there is no MWE in the question and I do not know how the title of the unnumbered chapter goes to the header. So its only a guess: add the chapter name and chapter number to the left mark in the \chaptermark command. Maybe you have to use \nouppercase for \leftmark, too.
\renewcommand{\chaptermark}[1]{%