debugging timing issue in simulation