changed encode to make for consistancy