get_targets NoneType error corrected