fix bug on open attachment