Added a status = 'all' option to smart query