instaceof check does not work