Made rewrite open when main file is opened
Merge branch 'dev'