Timeout function correction