Add exceptions in the save function