fixed time formatting / checked for nil