When you call the save function from the include file, it might act differently than in the main script. Check how you're calling it and make sure there are no lingering references to the file.