Fixing bug related to deadline