Re-applied working code from reference to index due to error in saving