Refactor popup list population into reusable function. Fix issue #13 by checking that currentTaskId != null