fixed a bad cast in trying to remove warnings