Corrected class casting for memberid