fixed bug where file was not being opened