f_sd and m_sd can be undefined here , corrected the condition to what I believe is the correct behavior