fixed save, needs a little more testing and theres an encoding bug