Prevent opening same file multipletimes