Fixed undefined $was_picked