Update time_manager to correct the foreign key bug