fixed double opening bug