replaced numeric check with null check and changed signature of drawMean