fixed open so file that is already opened will return the opened index