added conditinal logic for timezones to fix crashing