fix selecting tasks with NULL value