I don't think there is any need to move this code above the setView() call.  I think you can just delete the pendingPick test at the start.