Fixed classcast problem