added undefined catch when parsing time