Fixed instanceof to use interface instead of class