clean up scope and remove element after a backdrop click.