try encode! instead of encode