added conditions if no stop_time is nil