Fix next bug when no previous task was selected