fixed type safety warnings