saving existing file fixed references #3