Fixed Classcast exception issue.