changed more casting exceptions