fix encoding and stuff