added fix for a bug caused by zero based months