fixed add popup not closing gracefully