fix deadline handling