update and add dual likelihood

please add a null check and print the class name of the given one if wrong