Fix bug on save