removed unsafe casts and replaced them with regular ones
removed unsafe casts and replaced them with regular ones
merged