Fixed dialogue to save to file