added checkvalidmonthsanddays method