added isAssignableFrom check as per PR