Fixed edit not called when clicking elsewhere