Bug fixed on time_id calculation