fixed invalid month error when inserting to database