minor fix scope issue

When you close dialog the "$scope" of it still exist. And that cause an error when you multiple times call dialogs