Finished fixing double open issue