Allow closing dialog via template click handler
merge
better placing