After trying to do a whole bunch of stuff, I've found that if you turn on sandboxing saving does not work as intended. I've turned off sandboxing and everything works now!!